<template>
<div style="padding: 1%">
  <div style="text-align: right">
    <el-button type="success"  @click="dialogVisible = true" style="">上传文件</el-button>
  </div>

  <template>
    <el-table
      :data="tableData"
      style="width: 100%">
      <el-table-column
        prop="id"
        label="ID"
        width="380">
      </el-table-column>
      <el-table-column
        prop="name"
        label="文件名"
        >
      </el-table-column>
      <el-table-column
        prop="fileLength"
        label="文件大小"
      >
      </el-table-column>

    </el-table>
  </template>
  <!-- 打开测试窗口按钮 -->

  <el-dialog
    title="上传文件"
    :visible.sync="dialogVisible"
    width="50%"
    height="50%"
    :before-close="handleClose">
    <testDialog title="测试窗口"/>
  </el-dialog>

</div>
</template>

<script>
import {list} from "@/api/shareDrive/index";
import testDialog from "./upload";

export default {
  name: "list",
  components: {testDialog},
  data() {
    return {
      dialogVisible:false,
      tableData: [{
        date: '2016-05-02',
        name: '王小虎',
        id: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-04',
        name: '王小虎',
        id: '上海市普陀区金沙江路 1517 弄'
      }, {
        date: '2016-05-01',
        name: '王小虎',
        id: '上海市普陀区金沙江路 1519 弄'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        id: '上海市普陀区金沙江路 1516 弄'
      }]
    }
  },
  mounted(){
    list().then(response => {
      this.tableData = response.data
    })
  },
  methods:{
    handleClose(done) {
      done();
      list().then(response => {
        this.tableData = response.data
      })
    }
  }
}
</script>

<style scoped>

</style>
